home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / unixSyscall / RCS / gettimeofday.c,v < prev    next >
Encoding:
Text File  |  1991-10-03  |  2.6 KB  |  142 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.3.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     88.07.29.17.55.56;  author ouster;  state Exp;
  11. branches 1.3.1.1;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     88.07.29.17.39.34;  author ouster;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     88.06.19.14.31.29;  author ouster;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24. 1.3.1.1
  25. date     91.10.02.19.13.39;  author kupfer;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 1.3
  35. log
  36. @Lint.
  37. @
  38. text
  39. @/* 
  40.  * gettimeofday.c --
  41.  *
  42.  *    Procedure to map from Unix gettimeofday system call to Sprite.
  43.  *
  44.  * Copyright 1986 Regents of the University of California
  45.  * All rights reserved.
  46.  */
  47.  
  48. #ifndef lint
  49. static char rcsid[] = "$Header: gettimeofday.c,v 1.2 88/07/29 17:39:34 ouster Exp $ SPRITE (Berkeley)";
  50. #endif not lint
  51.  
  52. #include "sprite.h"
  53.  
  54. #include "compatInt.h"
  55. #include <sys/time.h>
  56. #include <spriteTime.h>
  57.  
  58.  
  59.  
  60. /*
  61.  *----------------------------------------------------------------------
  62.  *
  63.  * gettimeofday --
  64.  *
  65.  *    Procedure to map from Unix gettimeofday system call to 
  66.  *    Sprite Sys_GetTimeOfDay.
  67.  *
  68.  * Results:
  69.  *    UNIX_SUCCESS     - the call was successful.
  70.  *    UNIX_ERROR     - the call was not successful. 
  71.  *              The actual error code stored in errno.  
  72.  *
  73.  * Side effects:
  74.  *    None.
  75.  *
  76.  *----------------------------------------------------------------------
  77.  */
  78.  
  79. int
  80. gettimeofday(tp, tzp)
  81.     struct timeval *tp;
  82.     struct timezone *tzp;
  83. {
  84.     ReturnStatus status;    /* result returned by Sys_GetTimeOfDay */
  85.     int        localOffset;    /* offset in minutes from UTC */
  86.     Boolean    DST;        /* TRUE if Daylight Savings Time is observed */
  87.  
  88.     status = Sys_GetTimeOfDay((Time *) tp, &localOffset, &DST);
  89.     if (status != SUCCESS) {
  90.     errno = Compat_MapCode(status);
  91.     return(UNIX_ERROR);
  92.     } else {
  93.     if (tzp != (struct timezone *) NULL) {
  94.         /*
  95.          * Unix negates the local offset from UTC to make it positive
  96.          * for locations west of the prime meridian. 
  97.          */
  98.         tzp->tz_minuteswest     = -localOffset;
  99.         tzp->tz_dsttime         = DST;
  100.     }
  101.     return(UNIX_SUCCESS);
  102.     }
  103. }
  104. @
  105.  
  106.  
  107. 1.3.1.1
  108. log
  109. @Initial branch for Sprite server.
  110. @
  111. text
  112. @d11 1
  113. a11 1
  114. static char rcsid[] = "$Header: /sprite/src/lib/c/unixSyscall/RCS/gettimeofday.c,v 1.3 88/07/29 17:55:56 ouster Exp $ SPRITE (Berkeley)";
  115. @
  116.  
  117.  
  118. 1.2
  119. log
  120. @Lint.
  121. @
  122. text
  123. @d11 1
  124. a11 1
  125. static char rcsid[] = "$Header: gettimeofday.c,v 1.1 88/06/19 14:31:29 ouster Exp $ SPRITE (Berkeley)";
  126. d18 1
  127. @
  128.  
  129.  
  130. 1.1
  131. log
  132. @Initial revision
  133. @
  134. text
  135. @d11 1
  136. a11 1
  137. static char rcsid[] = "$Header: proto.c,v 1.1 86/03/04 16:46:31 douglis Exp $ SPRITE (Berkeley)";
  138. d49 1
  139. a49 1
  140.     status = Sys_GetTimeOfDay(tp, &localOffset, &DST);
  141. @
  142.